/*
 * Copyright (c) 2024. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package com.huawei.csi.tool.domain.score;

import javafx.scene.control.TreeItem;

/**
 * 提供覆盖率执行脚本和报告 （20）
 *
 * @author lxw
 */
public class LltScore extends AbstractScore {
    /**
     * LLT或HLT用例执行通过 （10）
     */
    private int lltScore = 10;
    /**
     * 覆盖率>80% （10）
     */
    private int coverageScore = 10;

    public LltScore() {
        super.beforeScore = lltScore + coverageScore;
    }

    @Override
    public int beforeVerifyScore() {
        return super.beforeScore;
    }

    @Override
    public int afterVerifyScore() {
        return  lltScore + coverageScore;
    }

    @Override
    @SuppressWarnings("all")
    public TreeItem<String> treeItem() {
        TreeItem<String> root = new TreeItem<>("覆盖率执行脚本和报告（" + afterVerifyScore() + "/" + beforeScore + ")");
        TreeItem<String> lltTreeItem = new TreeItem<>(lltScore + "/" + 10 + " LLT或HLT用例执行通过");
        TreeItem<String> coverageTreeItem = new TreeItem<>(coverageScore + "/" + 10 + " 覆盖率>80%");
        root.getChildren().addAll(lltTreeItem, coverageTreeItem);
        return root;
    }

    public int getLltScore() {
        return lltScore;
    }

    public void setLltScore(int lltScore) {
        this.lltScore = lltScore;
    }

    public int getCoverageScore() {
        return coverageScore;
    }

    public void setCoverageScore(int coverageScore) {
        this.coverageScore = coverageScore;
    }
}
